package com.yungu.swift.system.sys.model.param;

import com.yungu.swift.base.model.admin.AdminParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 路线新增或更新参数
 *
 * @author : cuixiuyin
 * @date : 2019/6/17
 */
@Data
@ApiModel
public class AdminRouteParam extends AdminParam {


    @ApiModelProperty(value = "uuid")
    private String uuid;

    /**
     * 起点uuid
     **/
    @ApiModelProperty(value = "起点uuid")
    private String originSiteUuid;

    /**
     * 终点uuid
     **/
    @ApiModelProperty(value = "终点uuid")
    private String destSiteUuid;

    /**
     * 起始运营时间
     **/
    @ApiModelProperty(value = "起始运营时间")
    private Date startTime;

    /**
     * 终止运营时间
     **/
    @ApiModelProperty(value = "终止运营时间")
    private Date endTime;

    /**
     * 线路有效预约时间
     **/
    @ApiModelProperty(value = "线路有效预约时间", example = "0")
    private Integer validSubMinutes;

    /**
     * 动态派单限制时间（如30分钟）
     **/
    @ApiModelProperty(value = "时间容忍度", example = "0")
    private Integer assignConfineMinutes;

    /**
     * 线路耗时（单位：分钟）
     **/
    @ApiModelProperty(value = "线路耗时（单位：分钟）", example = "0")
    private Integer consumeMinutes;

    /**
     * 取消规则
     **/
    @ApiModelProperty(value = "取消规则")
    private String cancelRule;

    /**
     * 开通状态：1开通 2关闭
     **/
    @ApiModelProperty(value = "1开通 2关闭", example = "1")
    private Integer status;

    /**
     * 计价规则数组
     **/
    @ApiModelProperty(value = "计价规则数组")
    private List<CalculationParam> calculations;

    /**
     * 地理围栏集合
     */
    @ApiModelProperty(value = "地理围栏集合")
    private List<AdminWayFenceParam> wayFenceList;

    /**
     * 夜间加价集合
     */
    @ApiModelProperty(value = "夜间加价集合")
    private List<NightFareParam> nightFareList;

    /**
     * 线路类型 1普通线路  2机场专线
     */
    @ApiModelProperty(value = "线路类型 1普通线路  2机场专线")
    private Integer wayType;

    /**
     * 整点出发 0未开启 1开启
     */
    @ApiModelProperty(value = "整点出发 0未开启 1开启")
    private int integralTimeDepart;

    /**
     * 半点出发 0未开启 1开启
     */
    @ApiModelProperty(value = "半点出发 0未开启 1开启")
    private int halfTimeDepart;


    /**
     * 取消费
     */
    @ApiModelProperty(value = "跨城取消费")
    private double crosstownCancelFee;

    /**
     * 计价规则模型
     */
    @Data
    public static class CalculationParam implements Serializable {

        @ApiModelProperty(value = "车型 uuid")
        private String carModelUuid;

        @ApiModelProperty(value = "成人单价", example = "0.0")
        private Double priceUnit;

        @ApiModelProperty(value = "包车价格", example = "0.0")
        private Double priceWeep;

        @ApiModelProperty(value = "二人快车价格", example = "0.0")
        private Double priceTwoPerson;
    }

    /**
     * 夜间加价
     */
    @Data
    public static class NightFareParam implements Serializable{

        /**
         * 开始时间
         */
        private Date startTime;

        /**
         * 结束时间
         */
        private Date endTime;

        /**
         * 加价
         */
        private Double raisePrice;

        /**
         * 序号
         */
        private Integer sequenceNumber;
    }
}
